<template>
    <div class="box">
        <div class="log">
            <p class="p1"><span>{{uname}}</span>，欢迎来到综合管理平台！</p>
            <p class="p2" @click="logout()">退出登录</p>
        </div>
    </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
    
    methods:{
       logout(){
            this.$store.commit("login/logout", 1)
            this.$router.push('/login')
       }
    },
    computed:{
        ...mapGetters(['uname']),
    }
};
</script>

<style lang="scss" scoped>
    .box{
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 99;
        background-color: #f2f2f2
    }
    
   .log{
       font-size: 14px;
       color: #999999;
       display: flex;
       width: 100%;
       align-items:center;
       justify-content: space-around;
    height: 67px;
    background-color: rgba(242, 242, 242,);
    .p2{
        color: #63B9BE;
        cursor:pointer
    }
} 


</style>